package com.cblz.bd.common.core.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

import java.io.Serializable;

/**
 * 回收规则表
 *
 * @TableName ba_security_data_recycle
 */
@TableName(value = "ba_security_data_recycle")
@Data
public class BaSecurityDataRecycle implements Serializable {
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
    /**
     * ID
     */
    @TableId(type = IdType.AUTO)
    private Integer id;
    /**
     * 规则名称
     */
    private String name;
    /**
     * 控制器
     */
    private String controller;
    /**
     * 控制器别名
     */
    @TableField("controller_as")
    private String controllerAs;
    /**
     * 对应数据表
     */
    @TableField("data_table")
    private String dataTable;
    /**
     * 服务层完整包路径
     */
    @TableField("serviceimpl_package")
    private String serviceImplPackage;
    /**
     * 数据表主键
     */
    @TableField("primary_key")
    private String primaryKey;
    /**
     * 状态:0=禁用,1=启用
     */
    private Integer status;

    @TableLogic
    @TableField("is_delete")
    private Integer isDelete;
    /**
     * 修改时间
     */
    private Object updatetime;
    /**
     * 创建时间
     */
    private Object createtime;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        BaSecurityDataRecycle other = (BaSecurityDataRecycle) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
                && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
                && (this.getController() == null ? other.getController() == null : this.getController().equals(other.getController()))
                && (this.getControllerAs() == null ? other.getControllerAs() == null : this.getControllerAs().equals(other.getControllerAs()))
                && (this.getDataTable() == null ? other.getDataTable() == null : this.getDataTable().equals(other.getDataTable()))
                && (this.getPrimaryKey() == null ? other.getPrimaryKey() == null : this.getPrimaryKey().equals(other.getPrimaryKey()))
                && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
                && (this.getUpdatetime() == null ? other.getUpdatetime() == null : this.getUpdatetime().equals(other.getUpdatetime()))
                && (this.getCreatetime() == null ? other.getCreatetime() == null : this.getCreatetime().equals(other.getCreatetime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
        result = prime * result + ((getController() == null) ? 0 : getController().hashCode());
        result = prime * result + ((getControllerAs() == null) ? 0 : getControllerAs().hashCode());
        result = prime * result + ((getDataTable() == null) ? 0 : getDataTable().hashCode());
        result = prime * result + ((getPrimaryKey() == null) ? 0 : getPrimaryKey().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getUpdatetime() == null) ? 0 : getUpdatetime().hashCode());
        result = prime * result + ((getCreatetime() == null) ? 0 : getCreatetime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", name=").append(name);
        sb.append(", controller=").append(controller);
        sb.append(", controllerAs=").append(controllerAs);
        sb.append(", dataTable=").append(dataTable);
        sb.append(", primaryKey=").append(primaryKey);
        sb.append(", status=").append(status);
        sb.append(", updatetime=").append(updatetime);
        sb.append(", createtime=").append(createtime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}